{{- $type := .Get "type" -}}
{{- $hide := .Get "hide" -}}
{{- $name := .Get "name" -}}
{{- $id := .Get "id" -}}
{{- $typeUpper := strings.FirstUpper $type -}}
{{- $icon := printf "css/fa/%s.svg" $type -}}

{{- $containerClass := "" -}}
{{- if eq $typeUpper "Proof" -}}
    {{- $containerClass = "collapsibleContainer" -}}
{{- else if eq $typeUpper "Definition" -}}
    {{- $containerClass = "env" -}}
    {{- $containerClass = printf "%s %s" $containerClass "envDef" -}}
{{- else -}}
    {{- $containerClass = "env" -}}
{{- end -}}

{{- $proofHeader := "proofHeader collapsibleHeaderButton collapsibleHeader noSelect" -}}
{{- if eq $hide "true" -}}
    {{- $proofHeader = printf "%s %s" $proofHeader "hide" -}}
{{- end -}}

<div class="{{ $containerClass }}" id="{{ $id }}">
    {{- if eq $typeUpper "Proof" -}}
        {{- if $name -}}
            <i class="{{ $proofHeader }}">{{ $typeUpper }} ({{ $name }}).</i>
        {{- else -}}
            <i class="{{ $proofHeader }}">{{ $typeUpper }}.</i>
        {{- end -}}

        <span class="collapsibleHintText noSelect"><i> Click to expand...</i></span>

        <span class="collapsibleContent">
            {{- .Inner | .Page.RenderString -}}
        </span>
    {{- else -}}
        <img class="icon noSelect listenDark" src="{{ absURL ""}}{{ $icon }}">

        {{- if $name -}}
            <b class="envTitle">{{ $typeUpper }} ({{ $name }}). </b>
        {{- else -}}
            <b class="envTitle">{{ $typeUpper }}. </b>
        {{- end -}}

        {{- .Inner | .Page.RenderString -}}
    {{- end -}}
</div>
